<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>test</title>
<script>
function log(message){
	if (typeof console == 'object'){
	  console.log(message);
	}else if(typeof opera == 'object'){
		opera.postError(message);
	}else if(typeof java == 'object' && typeof java.lang == 'object'){
	  java.lang.System.out.println(message);
	}
}
function sum(num1, num2){
	log("参数值分别为：" + num1 + "、" + num2);
	log("计算参数的和为：");
	var result = num1 + num2;
	log(result);
	return result;
}
sum(24, 45);


</script>
</head>
<body>
</body>
</html> 



